<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增联系人提醒')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-reminder-add">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">联系人ID：</label>
                <div class="col-sm-8">
                    <input name="contactId" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">提醒类型: </label>
                <div class="col-sm-8">
                    <select name="reminderType" class="form-control"
                            th:with="types=${@dict.getType('contact_reminder_type')}" required>
                        <option th:each="dict : ${types}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">重复类型: </label>
                <div class="col-sm-8">
                    <select name="repeatType" class="form-control"
                            th:with="types=${@dict.getType('contact_repeat_type')}" required>
                        <option th:each="dict : ${types}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">提醒时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="reminderTime" id="reminderTime" class="form-control"
                               placeholder="请选择提醒时间：年月日时分秒" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">是否重复(0-否,1-是)：</label>
                <div class="col-sm-8">
                    <input name="isRepeat" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">用户ID：</label>
                <div class="col-sm-8">
                    <input name="userId" class="form-control" type="text">
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
    var prefix = ctx + "contact/reminder"
    $("#form-reminder-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-reminder-add').serialize());
        }
    }

    $("input[name='reminderTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
    <!-- 使用laydate设置时间 -->
layui.use('laydate', function(){
var laydate = layui.laydate;
laydate.render({
elem: '#reminderTime',  // 时间输入组件的ID
type: 'datetime',
trigger: 'click'
});
}); // layui.use()

</script>
</body>
</html>